from django import template
from photo.models import Category

register=template.Library()

class AccordionNode(template.Node):
    def render(self, context):
        context.update({
            'categories': Category.all(),
        })
        result = template.loader.get_template('photo/accordion.html').render(context)
        context.pop()
        return result

@register.tag
def accordion(parser, token):
    return AccordionNode()